package com.chengang.crawler.jd.service;

import com.chengang.crawler.jd.dao.ItemDao;
import com.chengang.crawler.jd.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 陈刚
 * @ClassName ItemServiceImpl
 * @Description //TODO
 * @create 2020-02-08 17:39
 */
@Service
public class ItemServiceImpl implements ItemService {

    @Autowired
    private ItemDao itemDao;

    @Override
    public void save(Item item) {
        itemDao.save(item);
    }

    @Override
    public List<Item> findAll(Item item) {
        Example<Item> example = Example.of(item);
        List<Item> items = itemDao.findAll(example);
        return items;
    }
}
